﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLKDS.DTO;

namespace QLKDS.DAL
{
    public class EmployeeReportManager
    {

        public IList<EmployeeReport> ListEmployee()
        {
            using (var db = new QLKDSDataContext())
            {
                var queryEmployee = from d in db.Employees
                                    where d.Status.Equals(1)
                                    select new EmployeeReport { Id = d.Id, Code = d.Code, Fullname = d.Fullname, Sex = d.Sex, Birthday = d.Birthday, Email = d.Email, Address = d.Address, Mobile = d.Mobile, };

                return queryEmployee.OrderBy(d => d.Code).ToList();
            }
        }

    }
}
